#ifndef _HTTP_H_
#define _HTTP_H_

#pragma warning (disable : 4996)

char const GET_REQ[] = "GET";
char const HEAD_REQ[] = "HEAD";
char const PUT_REQ[] = "PUT";
char const DELETE_REQ[] = "DELETE";
char const TRACE_REQ[] = "TRACE";

enum Request
{ 
	HTTP_GET, 
	HTTP_HEAD, 
	HTTP_PUT, 
	HTTP_DELETE, 
	HTTP_TRACE,
	HTTP_NOT_IMPLEMENTED
};

enum Response 
{ 
	OK = 200,						
	CREATED = 201,					
	NOT_FOUND = 404,				
	NOT_IMPLEMENTED = 501,			
	NO_CONTENT = 204,				
	INTERNAL_SERVER_ERROR = 500		
};

#define CRLF "\r\n"

int HandleRequest(int i_Index);

void traceResponse(int i_Index);

void headResponse(int i_Index);

void toUpper(char* str);

int isMessageComplete(int i_Index);

void getFilePath(char* i_Path, char* o_Path);

void getResponse(int i_Index, char* i_Path, bool i_IncludeBody);

void HeaderMaker(enum Response i_ResponseType, int i_ContentLength, char* o_Buffer, int i_BufferSize);

void putResponse(int i_Index, char* i_Path);

int retrieveContentLength(int i_Index);

int getMessageBodyOffset(int i_Index);

char* retrieveBody(int i_Index);

void deleteResponse(int i_Index, char* i_Path);

void notImplemented(int i_Index);

#endif